/** @file   control.c
    @author M. P. Hayes, UCECE
    @date   21 August 2007
    @brief  Control algorithm.
*/

/*
 * TODO:
 * -  Optimize code, what types can be used to save space and still work.
 * -  Find out better constant values
 * */
#include "config.h"

static uint16_t frequency;

/** Update control algorithm.
    @param error difference between setpoint and measurement
    @return percentage heater should be on  */
uint8_t control_update(int8_t error)
{
	return (uint8_t)(75);
}


/** Initialise control algorithm.
 *  Note: Cannot be over ~200Hz
    @param update_rate update rate in Hz  */
void control_init (uint8_t update_rate)
{
	frequency = update_rate;
}
